package ch.wanandroid.lib.net.beans;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import java.util.List;

/**
 * Author: ch
 * Date: 2018/10/23 16:19
 * Description: ${DESCRIPTION}
 */

@Dao
public interface BannerDao {
    /**
     * 查询
     *
     * @return
     */
    @Query("SELECT * FROM banner_table")
    public List<BannerResponse.Banner> getAllBanners();

    /**
     * 添加
     *
     * @param banners
     */
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    public void insertBanner(BannerResponse.Banner... banners);

    /**
     * 更新
     *
     * @param banners
     */
    @Update
    public void updateBanner(BannerResponse.Banner... banners);

    /**
     * 删除
     *
     * @param users
     */
    @Delete
    public void deleteBanner(BannerResponse.Banner... users);


}
